import request from '@/utils/request'
import requestapp from '@/utils/requestapp'

export function login(data) { //注册
  return request({
    url: '/registry',
    method: 'post',
    data
  })
}
export function getPhoneCode(data) {
  return request({
    url: '/registry/phoneCode',
    method: 'post',
    data
  })
}
export function signIn(data) {//登录
  return request({
    url: '/userLogin/telLogin',
    method: 'post',
    data
  })
}
export function signCode(data) { //登录验证码
  return request({
    url: '/registry/phoneCode',
    // /login/phoneCode
    method: 'post',
    data
  })
}
export function testDele(data) { //测试删除用户
  return request({
    url: '/tools/deleteAuthor/' + data.isDeleteUser + '/' + data.phone,
    method: 'get',
    // params:data
  })
}

//作者个人资料 /author/selectAuthorInfo---刁皓毅
export function getAuthorInfo() {
  return request({
    url: '/author/selectAuthorInfo',
    method: 'get',
    // data
  })
}
//基本信息修改/author/updateUserInfo
export function baseModify(data) {
  return request({
    url: '/author/updateUserInfo',
    method: 'post',
    data
  })
}
//上传单个文件 /orangecatpc/file/uploadFile
export function uploadFile(data) {
  return request({
    url: '/file/uploadFile',
    method: 'post',
    data
  })
}
// 作者写作信息/center/writeInfo
export function writeInfo() {
  return request({
    url: '/center/writeInfo',
    method: 'get',
  })
}

//测试---接口--刁皓毅
// 新功能--发送验证码/userLogin/code
export function VerificationCode(data) {
  return request({
    url: '/userLogin/code?emailUrl=' + data,
    method: 'get',
  })
}
//新功能---登录 /userLogin/login
export function Lonsignin(data) {
  return request({
    url: '/userLogin/login',
    method: 'post',
    data,
  })
}
//获取用户信息 /userLogin/info
export function userInfo(data) {
  return request({
    url: '/userLogin/info?userId=' + data,
    method: 'get',
  })
}
//Apple登录三方信息 /userLogin/getCode
export function getCode(data) {
  return request({
    url: '/userLogin/getCode?code=' + data,
    method: 'get',
  })
}
// H5详情页 /bookInfo/bookDetailsH5
export function bookDetailsH5(data) {
  return requestapp({
    url: '/bookInfo/bookDetailsH5',
    method: 'post',
    data,
  })
}
